import request from '@/utils/request'

// 创建实时数据
export function createRealData(data) {
  return request({
    url: '/water/real-data/create',
    method: 'post',
    data: data
  })
}

// 更新实时数据
export function updateRealData(data) {
  return request({
    url: '/water/real-data/update',
    method: 'put',
    data: data
  })
}

// 删除实时数据
export function deleteRealData(id) {
  return request({
    url: '/water/real-data/delete?id=' + id,
    method: 'delete'
  })
}

// 获得实时数据
export function getRealData(id) {
  return request({
    url: '/water/real-data/get?id=' + id,
    method: 'get'
  })
}

// 获得实时数据分页
export function getRealDataPage(query) {
  return request({
    url: '/water/real-data/page',
    method: 'get',
    params: query
  })
}

// 获得全部实时数据
export function getRealDataAllList() {
  return request({
    url: '/water/real-data/all',
    method: 'get'
  })
}

// 获得今天某值数据
export function getRealDataList(tabl, lable) {
  return request({
    url: '/water/real-data/get-value-all-day?tabl=' + tabl +'&lable=' + lable,
    method: 'get'
  })
}
